﻿using System.Collections.Generic;
using System.Text;

namespace Students
{
    public class Student
    {
        private string firstName;
        private string lastName;
        private int fN;
        private string tel;
        private string email;
        private int groupNumber;

        public Student(string firstName, string lastName, int fN,
            string tel, string email, List<int> marks, int groupNUmber)
        {
            this.FirstName = firstName;
            this.LastName = lastName;
            this.FN = fN;
            this.Tel = tel;
            this.Email = email;
            this.Marks = marks;
            this.GroupNumber = groupNUmber;
        }

        public string FirstName
        {
            get
            {
                return firstName;
            }
            set
            {
                firstName = value;
            }
        }

        public string LastName
        {
            get
            {
                return lastName;
            }
            set
            {
                lastName = value;
            }
        }

        public int FN
        {
            get
            {
                return fN;
            }
            set
            {
                fN = value;
            }
        }

        public string Tel
        {
            get
            {
                return tel;
            }
            set
            {
                tel = value;
            }
        }

        public string Email
        {
            get
            {
                return email;
            }
            set
            {
                email = value;
            }
        }

        public List<int> Marks { get; set; }

        public int GroupNumber
        {
            get
            {
                return groupNumber;
            }
            set
            {
                groupNumber = value;
            }
        }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            foreach (int Mark in Marks)
            {
                sb.Append(string.Format("{0} ", Mark));
            }
            return string.Format(
                "FirstName: {0}\n" +
                "LastName: {1}\n" +
                "FN: {2}\n" +
                "Tel: {3}\n" +
                "Email: {4}\n" +
                "GroupNumber: {5}\n" +
                "Marks: {6}",
                FirstName, LastName, FN, Tel, Email, 
                GroupNumber, sb.ToString(0, sb.Length - 1));
        }
    }
}
